package com.fishcoco.app.yunhang.utils.retrofit.api;



import com.fishcoco.app.yunhang.utils.constant.ConstantUtil;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * Created by Lain on 2016/10/14.
 * 接口服务类 可以将所有接口都写在该类中
 */
//            @Field("client_id") String client_id,
//            @Field("client_secret") String client_secret,
public interface ApiService {


    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST("https://hooks.slack.com/services/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")
    Call<String> sendMsgToSlack(@Body RequestBody route);

/*------------------------------------------------------------------------*/

    /*    @FormUrlEncoded
        @POST(ConstantUtil.WEB_Register)
        Call<Void> register(
                @Field("phoneNumber") String phoneNum,
                @Field("identifyingCode") String identifyingCode,
                @Field("password") String password);
    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_Register)
    Call<Void> register(@Body RequestBody route);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_IdentifieStaff)
    Call<Void> identifieStaff(@Body RequestBody route);

    @GET(ConstantUtil.WEB_HmcoinList)
    Call<String> hmcoinList();

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_HmcoinBuy)
    Call<String> hmcoinBuy(@Body RequestBody route);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_HmcoinRecharge)
    Call<String> hmcoinRecharge(@Body RequestBody route);

    @GET
    Call<String> paymentStatus(@Url String url);

    @GET
    Call<MyOrderListResponse> orderList(@Url String url);

    @GET
    Call<String> payAgain(@Url String url);

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_Order_Refund)
    Call<String> orderRefund(@Body RequestBody route);

    @GET(ConstantUtil.WEB_Address_List)
    Call<List<BuyAddressResponse>> addressList();

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_Address_Create)
    Call<String> addressCreate(@Body RequestBody route);

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @PUT(ConstantUtil.WEB_Address_Create)
    Call<String> addressEdit(@Body RequestBody route);

    @DELETE
    Call<String> addressDelete(@Url String url);

    @GET(ConstantUtil.WEB_Customer_hmcoin)
    Call<String> customerHmcoin();

    @GET(ConstantUtil.WEB_Customer_Bill_HMCoin)
    Call<String> customerHmcoinBill();

    @GET
    Call<HMBillResponse> customerBill(@Url String url);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.WEB_Express_Apply)
    Call<String> expressApply(@Body RequestBody route);

    @GET
    Call<List<ZitidianResponse>> expressStations(@Url String url);


    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Login)
    Call<LoginBean.ObjEntity> login(
            @Field("username") String username,
            @Field("password") String password,
            @Field("grant_type") String grant_type,
            @Field("scope") String scope,
            @Header("Authorization") String authorization
    );

    @GET(ConstantUtil.WEB_User_Info)
    Call<AccountInfo> getUserInfo();


    @GET(ConstantUtil.WEB_Find_Customer)
    Call<CustomerInfo> findCustomer();

    @GET(ConstantUtil.WEB_Villages)
    Call<VillagesEntity> findVillages();

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Villages_by_Location)
    Call<VillagesEntity> findVillagesbyLocation(@Field("cityName") String cityName);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_PhoneNum_Register)
    Call<Void> phoneNumByRegister(
            @Field("phoneNumber") String phoneNum);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_PhoneNum_ResetPassword)
    Call<Void> phoneNumByReset(
            @Field("phoneNumber") String phoneNum);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Public_Repair_Management)
    Call<PublicTrouble> findPublicRepairManagement(
            @Field("villageId") String villageId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Person_Repair_Management)
    Call<PersonTrouble> findPersonRepairManagement(
            @Field("village") String village);
    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Public_Update_Order)
    Call<UniversalData> updatePublicOrder(
            @FieldMap Map<String, String> map);

    @Headers({"Content-Type: application/x-www-form-urlencoded;charset=UTF-8"})//需要添加头
    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Person_Update_Order)
    Call<UniversalData> updatePersonOrder(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Reset_Password)
    Call<Void> resetPassword(
            @Field("phoneNumber") String phoneNum,
            @Field("identifyingCode") String identifyingCode,
            @Field("password") String password);

    @Multipart
    @POST(ConstantUtil.WEB_File_ImgFileUpload)
    Call<ImgFileUpload> upload(@Part("description") RequestBody description,
                               @Part MultipartBody.Part file);

    @Multipart
    @POST(ConstantUtil.WEB_File_Avatar)
    Call<UniversalData> uploadAvatar(@Part("description") RequestBody description,
                                     @Part MultipartBody.Part file);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Update_Customer)
    Call<UpdateCustomerResponse> updateCustomer(
            @Field("nickName") String nickName);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Public_My_Order_History)
    Call<MyPublicOrderHistory> findMyOrderHistory(
            @Field("villageId") String villageId,
            @Field("customerHouseId") String customerHouseId,
            @Field("repairProgress") String repairProgress);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Public_Order_Status_Change)
    Call<UniversalData> changeOrderStatus(
            @Field("publicRepairId") String publicRepairId,
            @Field("operationType") String operationType);

    @GET(ConstantUtil.WEB_Find_Customer_Houses)
    Call<CustomerHouses> findCustomerHouses();

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Delete_Houses)
    Call<UniversalData> deleteHouse(
            @Field("houseId") String houseId);

    @GET(ConstantUtil.WEB_Find_All_Citys)
    Call<Citys> findAllCitys();

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_All_Villages_by_City)
    Call<VillagesInCity> findVilllagesByCity(
            @Field("cityCode") String cityCode);

    @GET(ConstantUtil.WEB_Find_House_Type)
    Call<HouseType> findHouseType();

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Builds)
    Call<BuildsByHouseType> findBuildsByHouseType(
            @Field("villageId") String villageId,
            @Field("houseType") String houseType);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Units)
    Call<BuildsByHouseType> findUnitsByBuild(
            @Field("villageId") String villageId,
            @Field("houseType") String houseType,
            @Field("building") String building);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Doors)
    Call<BuildsByHouseType> findDoorsByUnit(
            @Field("villageId") String villageId,
            @Field("houseType") String houseType,
            @Field("building") String building,
            @Field("unit") String unit);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Register_House)
    Call<UniversalData> registerHouse(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Default_Property)
    Call<UniversalData> defaultProperty(
            @Field("houseId") String houseId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Public_Repair_Comment)
    Call<UniversalData> publicRepairComment(
            @Field("publicRepairId") String publicRepairId,
            @Field("commentContent") String commentContent,
            @Field("star") String star);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Person_Repair_Comment)
    Call<UniversalData> personRepairComment(
            @Field("individualRepairId") String individualRepairId,
            @Field("commentContent") String commentContent,
            @Field("star") String star);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Person_Repairs)
    Call<MyPersonOrderHistory> findPersonRepairs(
            @Field("village") String individualRepairId,
            @Field("customerHouse") String commentContent,
            @Field("repairProgress") String star);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Update_Work_Order)
    Call<UniversalData> updateWorkOrder(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Suggest_Submit)
    Call<UniversalData> suggestSubmit(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Suggest)
    Call<MySuggestResponse> findSuggest(
            @Field("propertyId") String propertyId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Work_Order)
    Call<ComplaintResponse> findWorkOrders(
            @Field("villageId") String villageId,
            @Field("customerHouseId") String customerHouseId,
            @Field("complainStatus") String complainStatus);

    @GET(ConstantUtil.WEB_Find_Address)
    Call<AddressResponse> findAddresses();

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Update_Address)
    Call<UniversalData> updateAddress(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Delete_Address)
    Call<UniversalData> deleteAddress(
            @Field("addressId") String addressId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Get_Level_Info)
    Call<ShengShiQuResponse> getLevelInfo(
            @Field("level") String level);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Get_Children_Info)
    Call<ShengShiQuResponse> getChildrenInfo(
            @Field("parentCode") String parentCode);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Update_Default_Address)
    Call<UniversalData> defaultAddress(@Field("addressId") String addressId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Get_Fees_List)
    Call<WeiJiaoFeiResponse> feesList(
            @Field("houseId") String houseId,
            @Field("tags") String tags);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Get_Fees_Base)
    Call<FeesBaseResponse> feesBase(
            @Field("houseId") String houseId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Submit_Fees_Payment)
    Call<UniversalData> submitFeesPayment(
            @FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Find_Fees_Price)
    Call<WeiJiaoFeiResponse> findFeesPrice(
            @Field("houseId") String houseId,
            @Field("billType") String billType);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Notice_Find_Village_Notices)
    Call<VillageNotiesResponse> findVillageNotices(
            @Field("villageId") String villageId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Advertises_App_Wy_Data)
    Call<AdvertisesResponse> advertisesAppWyData(
            @Field("appsType") String appsType,
            @Field("module") String module,
            @Field("usageType") String usageType,
            @Field("usageName") String usageName);


    @FormUrlEncoded
    @POST(ConstantUtil.WEB_FRONT_CATEGORY_QUERY)
    Call<String> getTopCategory(
            @Field("level") String level,
            @Field("page") String page,
            @Field("pageSize") String pageSize);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_FRONT_Product_QUERY)
    Call<String> getDataByCategory(
            @Field("categoryId") String categoryId,
            @Field("serviceModule") String serviceModule,
            @Field("fromPrice") String fromPrice,
            @Field("toPrice") String toPrice,
            @Field("brandId") String brandId,
            @Field("haveStock") String haveStock);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Front_Query_Brands)
    Call<String> getBrandsByCategory(
            @Field("categoryId") String categoryId);

    @FormUrlEncoded
    @POST(ConstantUtil.WEB_Product_Query_Detail)
    Call<String> getProductQueryDetail(
            @Field("productId") String productId);
    */


    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.API_URL_LOGIN)
    Call<String> login(@Body RequestBody route);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.API_URL_REGISTER)
    Call<String> register(@Body RequestBody route);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.API_URL_CHANGE_PASSWORD)
    Call<String> changePassword(@Body RequestBody route);

    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
    @POST(ConstantUtil.API_URL_CHANGE_USERNAME)
    Call<String> changeUsername(@Body RequestBody route);
}

